<?php if($format=='table'or $format=='html'):?>
<?php //sfContext::getInstance()->getLogger()->debug("*******************Start Baby!");?>
<?php //$funcs = new Util();?>
<?php $dateFormatter = new sfDateFormat($sf_user->getCulture());
	  ?>
	  
<table>
<thead>
	<tr>
	<?php foreach($objDef->attributes as $fieldName => $att):?>
		<?php if(($att['list'] and !in_array($fieldName, $hide) and $att['type'] != 'List')or(in_array($fieldName,$add))or($allFields=='true')):?>
				<?php // $nouvLabel = $funcs->stripCaract($att['label']);?>
		  		<th><?php echo $att['label'];?></th>
		<?php endif;?>
    <?php endforeach;?>
  	</tr>
</thead>
<tbody>
<?php foreach($results as $ligne):?>
	<tr>
	<?php foreach($objDef->attributes as $fieldName => $att):?>
		<?php if(($att['list'] and !in_array($fieldName, $hide) and $att['type'] != 'List')or(in_array($fieldName,$add))or($allFields=='true')):?>
		
				<th><?php
				//echo utf8_decode($ligne->$fieldName);
				if($att['type']=='date'){ 
					echo $dateFormatter->format($ligne[$fieldName], 'd/M/y', null, $objDef->charset);
				}else{
					//echo utf8_decode($ligne[$fieldName]);
					echo utf8_decode($objDef->renderAttributeValue($ligne,$fieldName));
				}
					//echo utf8_decode($objDef->renderAttributeValue($ligne,$fieldName));?></th>
				<?php // sfContext::getInstance()->getLogger()->debug(" memory usage: " . (memory_get_usage(true) / 1024 / 1024) . " MB");?>
		<?php endif;?>
    <?php endforeach;?>
	</tr>
<?php endforeach;?>
</tbody>
</table>
<?php sfContext::getInstance()->getLogger()->debug(" Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB");?>

<?php endif;?>